package com.me.mapper;

import com.me.pojo.Pokemon;
import com.me.pojo.Trainer;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface TrainerMapper {
    //查询所有宝可梦

    @Select("select * from tb_trainer")
    List<Trainer> selectall();

    @Options(useGeneratedKeys = true,keyColumn = "id", keyProperty = "id")
    @Insert("insert into tb_trainer values(null,#{name},#{sex},#{age},#{area})")
    void addtrainer(Trainer trainer);

    @Select("select * from tb_trainer where id=#{id}")
    Trainer selecttrainerbyid(int id);


    void updatetrainer(Trainer trainer);

    @Delete("delete from tb_trainer where id=#{id}")
    void deletetrainer(int id);

    Integer trainerCount();

    List<Trainer> searchTrainerBykeyword(String keyword);



}
